<?php
/**
 * Created by PhpStorm.
 * User: fengyan
 * Date: 17-11-8
 * Time: 下午2:54
 */

namespace App\Http\Controllers\Home;


use Illuminate\Http\Request;
use App\Repositories;
class IndexController extends BaseController
{
    /**
     * 首页地址
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index(Request $request)
    {
        $this->getSeoInfo([], [], []);

        $this->withData('advHomeIndexDesc', Repositories\Basic\AdvRepository::getInstance()->getAdvDataListByName('home_index_desc'));

        $model = Repositories\Portal\DocumentRepository::getInstance()->getSelectModel([
            'status' => 99,
        ]);

        $paginateData = $model->orderBy('id', 'asc')->paginate();

        return $this->fetch('index', ['data'=>$paginateData]);
    }

    public function map()
    {
        $this->getSeoInfo([], [], []);

        return $this->fetch('map', ['data'=>[]]);
    }

    /**
     * 服务调用
     * @return mixed
     */
    public function getServiceRepository()
    {
        // TODO: Implement getServiceRepository() method.
    }
}